﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.NetoBruto"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class NetoBrutoEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// TextBox for the StopaPrireza property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxStopaPrireza;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the StopaPrireza property.
		/// </summary>
		protected System.Windows.Forms.Label uxStopaPrirezaLabel;
		
		/// <summary>
		/// TextBox for the Kpr property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKpr;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kpr property.
		/// </summary>
		protected System.Windows.Forms.Label uxKprLabel;
		
		/// <summary>
		/// TextBox for the Kpr25 property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKpr25;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kpr25 property.
		/// </summary>
		protected System.Windows.Forms.Label uxKpr25Label;
		
		/// <summary>
		/// TextBox for the Kpr35 property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKpr35;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kpr35 property.
		/// </summary>
		protected System.Windows.Forms.Label uxKpr35Label;
		
		/// <summary>
		/// TextBox for the Kpr45 property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKpr45;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kpr45 property.
		/// </summary>
		protected System.Windows.Forms.Label uxKpr45Label;
		#endregion
		
		#region Main entity
		private Entities.NetoBruto _NetoBruto;
		/// <summary>
		/// Gets or sets the <see cref="Entities.NetoBruto"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.NetoBruto"/> instance.</value>
		public Entities.NetoBruto NetoBruto
		{
			get {return this._NetoBruto;}
			set
			{
				this._NetoBruto = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxStopaPrireza.DataBindings.Clear();
			this.uxStopaPrireza.DataBindings.Add("Text", this.uxBindingSource, "StopaPrireza", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKpr.DataBindings.Clear();
			this.uxKpr.DataBindings.Add("Text", this.uxBindingSource, "Kpr", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKpr25.DataBindings.Clear();
			this.uxKpr25.DataBindings.Add("Text", this.uxBindingSource, "Kpr25", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKpr35.DataBindings.Clear();
			this.uxKpr35.DataBindings.Add("Text", this.uxBindingSource, "Kpr35", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKpr45.DataBindings.Clear();
			this.uxKpr45.DataBindings.Add("Text", this.uxBindingSource, "Kpr45", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="NetoBrutoEditControlBase"/> class.
		/// </summary>
		public NetoBrutoEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_NetoBruto != null) _NetoBruto.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxStopaPrireza = new System.Windows.Forms.TextBox();
			uxStopaPrirezaLabel = new System.Windows.Forms.Label();
			this.uxKpr = new System.Windows.Forms.TextBox();
			uxKprLabel = new System.Windows.Forms.Label();
			this.uxKpr25 = new System.Windows.Forms.TextBox();
			uxKpr25Label = new System.Windows.Forms.Label();
			this.uxKpr35 = new System.Windows.Forms.TextBox();
			uxKpr35Label = new System.Windows.Forms.Label();
			this.uxKpr45 = new System.Windows.Forms.TextBox();
			uxKpr45Label = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxStopaPrirezaLabel
			//
			this.uxStopaPrirezaLabel.Text = "StopaPrireza:";
			this.uxStopaPrirezaLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxStopaPrirezaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxStopaPrirezaLabel);			
			//
			// uxStopaPrireza
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxStopaPrireza);
			this.uxStopaPrireza.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxStopaPrireza);
			//
			// uxKprLabel
			//
			this.uxKprLabel.Text = "Kpr:";
			this.uxKprLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxKprLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKprLabel);			
			//
			// uxKpr
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr);
			this.uxKpr.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxKpr);
			//
			// uxKpr25Label
			//
			this.uxKpr25Label.Text = "Kpr25:";
			this.uxKpr25Label.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxKpr25Label);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr25Label);			
			//
			// uxKpr25
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr25);
			this.uxKpr25.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxKpr25);
			//
			// uxKpr35Label
			//
			this.uxKpr35Label.Text = "Kpr35:";
			this.uxKpr35Label.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxKpr35Label);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr35Label);			
			//
			// uxKpr35
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr35);
			this.uxKpr35.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxKpr35);
			//
			// uxKpr45Label
			//
			this.uxKpr45Label.Text = "Kpr45:";
			this.uxKpr45Label.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxKpr45Label);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr45Label);			
			//
			// uxKpr45
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKpr45);
			this.uxKpr45.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxKpr45);
			// 
			// NetoBrutoEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "NetoBrutoEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
